|
|
|
|
|
|
|
Figure 2.10.
Changing fonts in the Rich TextBox control
allows you to enhance text being entered. |
|
|
|
|
|
|
|
|
LISTING 2.3. FONTCHANGE.TXTUSING THE FONT COMMON DIALOG BOX TO CHANGE FONT PROPERTIES. |
|
|
|
 |
|
|
|
|
1: Private Sub cmdClose_Click()
2: End
3: End Sub
4:
5: Private Sub cmdFont_Click()
6: dlgFileSelect.Flags = cdlCFEffects Or cdlCFBoth
7: dlgFileSelect.ShowFont
8: rtfDisplay.SelFontName = dlgFileSelect.FontName
9: rtfDisplay.SelFontSize = dlgFileSelect.FontSize
10: rtfDisplay.SelColor = dlgFileSelect.Color
11: End Sub
12:
13: Private Sub cmdOpen_Click()
14: rtfDisplay.LoadFile txtSourceFile.Text, rtfText
15: End Sub
16:
17: Private Sub cmdSourceFile_Click()
18: dlgFileSelect.Flags = cdlOFNFileMustExist
19: dlgFileSelect.ShowOpen
20: txtSourceFile.Text = dlgFileSelect.filename
21:
22: End Sub |
|
|
|
|
|
|
|
|
By this time you should be able to set the properties for each control based on the code. The properties for the RTF control sets the font information for just the selected text. Run this application and have some fun with the fonts. You'll see the features of both the Rich TextBox control and the Font dialog box. As you've seen earlier when working |
|
|
|
|
|